<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>keeping .htaccess files from apache</TITLE>
<LINK REL="STYLESHEET" HREF="manual.css">
</HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#00003F" ALINK="#FF0000">
<DIV CLASS="body">

<DIV ALIGN="CENTER">
 <A HREF="http://nanoweb.si.kz/"><IMG BORDER="0" SRC="/icons/nanoweb.png" ALT="[NANOWEB DOCUMENTATION]"></A>
 <H3><SMALL>NANOWEB</SMALL>, the aEGiS PHP web server</H3>
</DIV>

<H1 ALIGN="CENTER">keeping apaches .htaccess files Features</H1>

<SMALL>NANOWEB</SMALL> uses a different configuration file layout (ini
style) than apache (markup style) does; also most of the directives names
differ.
<br>
This is no problem if you start with nanoweb or if you're going to switch to
nanoweb fully. However, when you need or want to switch between these two
webservers you need to take care, because apache throws an HTTP error 500 on
any directive found in one of the per-directory configuration files if it
doesn't know it. Nanoweb in contrast just ignores any directive it doesn't
know; so from it's point there is no problem at all.
<br>
<br>
However, as nanoweb per default looks for configuration directives in
<b>.nwaccess</b> and apache reads <b>.htaccess</b> instead there's no
problem for the two different servers if you just place two versions in
every directory.
<br>
<br>
As there exists a few configuration directives in nanoweb that were designed
for compatibility with existing .htaccess files from apache
(<A HREF="mod_rewrite.html">mod_rewrite</A> for example), you may wish
nanoweb to read .htaccess files (<A HREF="core.html#accessfile">AccessFile</A>
directive) and don't want to keep two concurrent versions up to date.
<br>
The solution to this problem is to prevent apache from reading configuration
directives it doesn't understand:
<br>
<PRE CLASS="samp">
# following directives are understood by apache and nanoweb:

DirectoryIndex  index.php index.pdf index.html
LanguagePriority ep en de fr es

RewriteRule ^file(.+)$ newpath/newfile$1  [NC]


# this is apache-specific and thus ignored by nanoweb

AddHandler cgi-script .bat


# apache will ignore everything in between following "tags",
# while nanoweb still notices it
&lt;IfModule nanoweb&gt;

  # nanoweb version of AddHandler
  ParseExt = .bat CGI C:\WINDOWS\COMMAND.COM $FILENAME

  # multi-purpose http communication enhancement
  AddHeader = X-Powered-by: beer

  # and all others...
  AllowExtSymLinks = 1
  FbSortOrder = name

&lt;/IfModule&gt;

</PRE>
<SMALL>(sample .htaccess file)</SMALL><BR>

<br>
<BR><HR NOSHADE COLOR="#063239">
 <H3 ALIGN="CENTER"> <SMALL>NANOWEB</SMALL>, the aEGiS PHP web server </H3>
<DIV CLASS="navline"><A HREF="index.html">Index</A> &nbsp; <A HREF="modules.html">Modules</A> &nbsp; <A HREF="core.html">Configuration</A> &nbsp; <A HREF="../">READMEs</A> &nbsp; <A HREF="faq.html">FAQ</A> &nbsp; <A HREF="http://forums.t0x.net/viewforum.php?f=1">Support Forum</A></DIV>

</DIV>
</BODY>
</HTML>
